<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      .tab {
        display: flex;
        height: 60px;
        border-bottom: 2px solid #b26a69;
      }
      .tab li {
        width: 100px;
        height: 100%;
        line-height: 60px;
        color: #000;
        font-weight: bolder;
        text-align: center;
        list-style: none;
      }
      .tab li.active {
        background-color: #f22520;
        color: #fff;
      }
    </style>
  </head>
  <body>
    <div id="box">
      <div>
        <ul class="tab">
          <li
            @click="current = index"
            :class="{active: index === current}"
            v-for="(item, index) in tabList"
            :key="item.id"
          >
            {{item.title}}
          </li>
        </ul>
      </div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#box",
        data: {
          current: 0,
          tabList: [
            {
              id: 0,
              title: "京东秒杀",
            },
            {
              id: 1,
              title: "每日特价",
            },
            {
              id: 2,
              title: "品类秒杀",
            },
          ],
        },
      });
    </script>
  </body>
</html>
